<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta charset="utf-8" />
		<title>用户组修改 - FCMS后台管理</title>
				<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link href="/fcms/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome.min.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- fonts -->

		<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" /> -->

		<!-- ace styles -->

		<link rel="stylesheet" href="/fcms/Public/assets/css/ace.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/fcms/Public/assets/css/fcms.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/fcms/Public/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="/fcms/Public/assets/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="/fcms/Public/assets/js/html5shiv.js"></script>
		<script src="/fcms/Public/assets/js/respond.min.js"></script>
		<![endif]-->
		<link rel="stylesheet" href="/fcms/Public/assets/css/jquery-ui-1.10.3.full.min.css" />
		<style>
			.checkbox label{
				padding-left: 0;
			}
			.ui-accordion .ui-accordion-content{
				padding-top: 2px!important;
			}
			.b{
				font-weight: 10px;
			}
		</style>
		
	</head>

	<body>
		

		<div class="wrap">
			<div class="space-6"></div>

			<div class="col-sm-12">
				<form action="<?php echo U('updateGroup');?>" method="post" class="form-horizontal" role="form">
					<div class="form-group">
						<div class="col-xs-12 col-sm-12">
							<input type="hidden" name="id" value="<?php echo ($data["id"]); ?>" />
							<input type="text" name="title" id="" placeholder="组名" class="col-xs-10 col-sm-6 col-md-4" value="<?php echo ($data["title"]); ?>" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-xs-12 col-sm-12">
							<select name="status" class="col-xs-10 col-sm-6 col-md-4 " id="form-field-select-1">
								<option value="1" <?php if($data['status'] == 1): ?>selected<?php endif; ?>>可用</option>
								<option value="0" <?php if($data['status'] == 0): ?>selected<?php endif; ?>>禁用
							</select>
						</div>
					</div>
					
					<div class="form-group">
						<div class="col-sm-6">
							<h3 class="header blue lighter smaller">
								<i class="icon-list smaller-90"></i>
								权限列表
							</h3>

							<div id="accordion" class="accordion-style2">
								<?php if(is_array($list)): foreach($list as $key=>$vo): ?><div class="group">
										<h3 class="accordion-header"><?php echo ($vo["controller"]["name"]); ?> - <?php echo ($vo["controller"]["title"]); ?></h3>
	
										<div>
											<div class="checkbox">
												<label>
												<input type="checkbox" class="ckall ace" /><span class="lbl b"> 全选/反选</span>
												</lable>
											</div>
											<?php if(is_array($vo['rules'])): foreach($vo['rules'] as $key=>$rule): ?><div class="checkbox">
													<label>
														<input name="rule[]" <?php if(is_array($data['rules'])): foreach($data['rules'] as $key=>$r): if($rule['id'] == $r): ?>checked<?php endif; endforeach; endif; ?> value="<?php echo ($rule["id"]); ?>" type="checkbox" class="ace">
														<span class="lbl"> <?php echo ($rule["name"]); ?> - <?php echo ($rule["title"]); ?></span>
													</lable>
												</div><?php endforeach; endif; ?>
										</div>
									</div><?php endforeach; endif; ?>

							</div><!-- #accordion -->
						</div><!-- ./span -->
					</div>

					<div class="clearfix form-group">
						<div class=" col-md-9">
							<button class="btn btn-info" type="submit">
								<i class="icon-ok bigger-110"></i>
								提交
							</button>

							&nbsp; &nbsp; &nbsp;
							<a class="btn" href="javascript:history.go(-1)">
								<i class="icon-undo bigger-110"></i>
								返回
							</a>
						</div>
					</div>

				</form>
			</div>


			<div class="vspace-sm"></div>

		</div><!-- /row -->



		<div class="row">
			<div class="col-sm-6">
				<div class="widget-box transparent" id="recent-box">
				</div><!-- /widget-box -->
			</div><!-- /col -->
		</div><!-- /row -->




		<!-- basic scripts -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='/fcms/Public/assets/js/jquery-2.0.3.min.js'>"+"<"+"script>");
		</script>


		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='/fcms/Public/assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");
		</script>
		<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/fcms/Public/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
		</script>
		<script src="/fcms/Public/assets/js/bootstrap.min.js"></script>
		<script src="/fcms/Public/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->
		<script src="/fcms/Public/assets/js/jquery-ui-1.10.3.full.min.js"></script>
		<script src="/fcms/Public/assets/js/jquery.ui.touch-punch.min.js"></script>


		<!--[if lte IE 8]>
		  <script src="/fcms/Public/assets/js/excanvas.min.js"></script>
		<![endif]-->

		<!-- ace scripts -->

		<script src="/fcms/Public/assets/js/ace-elements.min.js"></script>
		<script src="/fcms/Public/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			$(function(){
				//jquery accordion
				$( "#accordion" ).accordion({
					collapsible: true ,
					heightStyle: "content",
					animate: 250,
					header: ".accordion-header"
				}).sortable({
					axis: "y",
					handle: ".accordion-header",
					stop: function( event, ui ) {
						// IE doesn't register the blur when sorting
						// so trigger focusout handlers to remove .ui-state-focus
						ui.item.children( ".accordion-header" ).triggerHandler( "focusout" );
					}
				});
				
				//判断选中
				$('.ckall').each(function(){
					if($(this).parents('.checkbox').siblings().find('input').prop('checked')){
					$(this).prop('checked',true);
				}
				})
				
				//全选框
				$('.ckall').on('click', function(){
					
					if($(this).is(':checked')){
						$(this).parents('.checkbox').siblings().find('input').prop('checked',true);
					} else {
						$(this).parents('.checkbox').siblings().find('input').prop('checked',false);
					}
					
				});
			});
			
		</script>

</body>
</html>